import { mapData } from "@/utils/mapData"
import { Tag } from "antd";
import { formatDate } from "@/utils/format";
// 员工姓名	调整后薪资	时间	调薪原因


export const typeRecord = {
    // 绩效考核
    assessmentList: [
        {
            title: "员工姓名",
            dataIndex: "staffName",
            align: "center",
            render: (staffName) => staffName.userName
        },
        {
            title: "考核等级",
            align: "center",
            dataIndex: "result",
        },
        {
            title: "调整职级",
            align: "center",
            dataIndex: "currentLevel",
            render: (data) => data.levelName
        },
        {
            title: "对应职级分数",
            align: "center",
            dataIndex: "standardScore",
        },
        {
            title: "考核得分",
            align: "center",
            dataIndex: "assessmentScore",
        },
    ],
    // 奖惩记录
    rewardAndPunishment: [
        {
            title: "员工姓名",
            dataIndex: "staffName",
            align: "center",
            render: (staffName) => staffName.userName
        },
        {
            title: "奖惩类型",
            dataIndex: "type",
            align: "center",
            render: (type) => <Tag color={type > 2 ? '#f50' : '#108ee9'}>{mapData.rewardType[type - 1]}</Tag>
        },
        {
            title: "时间",
            dataIndex: "date",
            align: "center",
            render: (date) => formatDate(date)
        },
        {
            title: "原因",
            dataIndex: "reason",
            align: "center"
        },
    ],
    // 	调薪记录
    salaryAdjustment: [
        {
            title: "员工姓名",
            dataIndex: "staffName",
            align: "center",
            render: (staffName) => staffName.userName
        },
        {
            title: "调整后薪资",
            dataIndex: "newSalary",
            align: "center",
            render: (newSalary) => `${newSalary} 元`
        },
        {
            title: "时间",
            dataIndex: "startTime",
            align: "center",
            render: (date) => formatDate(date)
        },
        {
            title: "调薪原因",
            dataIndex: "reason",
            align: "center",
            render: (type) => <Tag color={'#108ee9'}>{mapData.salaryType[type - 1]}</Tag>

        },
    ]
}